<!DOCTYPE html>
{% from 'bootstrap/utils.html' import render_messages %}
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>{{ config.SITE_NAME }}_后台管理中心</title>
    <base href="{{ request.headers['Host'] }}" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="robots" content="nofollow" />
    {%- if not is_pjax -%}
    <!-- Font Awesome Icons -->
    <link rel="stylesheet"
          href="{{ url_for('admins.static', filename='lte/plugins/sweetalert2-theme-bootstrap-4/bootstrap-4.min.css') }}">
    <link rel="stylesheet"
          href="{{ url_for('admins.static', filename='lte/plugins/fontawesome-free/css/all.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('admins.static', filename='lte/plugins/select2/css/select2.min.css') }}">
    <link rel="stylesheet"
          href="{{ url_for('admins.static', filename='lte/plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css') }}">
    <link rel="stylesheet"
          href="{{ url_for('admins.static', filename='lte/plugins/overlayScrollbars/css/OverlayScrollbars.min.css') }}">
    <link rel="stylesheet"
          href="{{ url_for('admins.static', filename='lte/plugins/overlayScrollbars/css/OverlayScrollbars.min.css') }}">
    <link rel="stylesheet"
          href="{{ url_for('admins.static', filename='lte/plugins/icheck-bootstrap/icheck-bootstrap.min.css') }}">
    <!-- Theme style -->
    <link rel="stylesheet" href="{{ url_for('admins.static', filename='lte/style/css/adminlte.min.css') }}">
    {%- endif %}
</head>
<body class="hold-transition sidebar-mini layout-fixed layout-footer-fixed">
<div class="wrapper">
    {% if not is_pjax -%}
    {% include 'base/nav.html' %}
    {% include 'base/aside.html' %}
    {%- endif %}
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper" id="pjax-container">
        {%- block content_header %}
        <div class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-6">
                        <h5 class="m-0 text-dark">{{ page_title }}</h5>
                    </div><!-- /.col -->
                    <div class="col-sm-6">
                        <ol class="breadcrumb float-sm-right">
                            <li class="breadcrumb-item"><a href="{{ url_for('admins.dashboard') }}">主页</a></li>
                            <li class="breadcrumb-item active">{{ page_title }}</li>
                        </ol>
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.container-fluid -->
        </div>
        {% endblock -%}

        <!-- Main content -->
        {% block content -%}
        <div class="content">
            <div class="container-fluid">
                {{ render_messages() }}
                {%- block main -%}{%- endblock -%}
            </div>
        </div>
        {%- endblock -%}
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
    {%- if not is_pjax -%}
    <!-- Control Sidebar -->
    <aside class="control-sidebar control-sidebar-dark">
        <!-- Control sidebar content goes here -->
        <div class="p-3">
            <h5>Title</h5>
            <p>Sidebar content</p>
        </div>
    </aside>
    <!-- /.control-sidebar -->

    <!-- Main Footer -->
    <footer class="main-footer">
        <!-- To the right -->
        <div class="float-right d-none d-sm-inline">
            空谈误国实干兴邦
        </div>
        <!-- Default to the left -->
        <strong>河北鼎道网络技术有限公司出品</strong>
    </footer>
    {%- endif %}
</div>
<!-- ./wrapper -->


{%- if not is_pjax -%}
<!-- REQUIRED SCRIPTS -->
<!-- jQuery -->
<script src="{{ url_for('admins.static', filename='lte/plugins/jquery/jquery.min.js') }}"></script>
<!-- Bootstrap 4 -->
<script src="{{ url_for('admins.static', filename='lte/plugins/bootstrap/js/bootstrap.bundle.min.js') }}"></script>
<!-- AdminLTE App -->

<script src="{{ url_for('admins.static', filename='pjax/jquery.pjax.js') }}"></script>
<script src="{{ url_for('admins.static', filename='lte/plugins/sweetalert2/sweetalert2.min.js') }}"></script>
<script src="{{ url_for('admins.static', filename='lte/plugins/select2/js/select2.full.min.js') }}"></script>
<script src="{{ url_for('admins.static', filename='lte/plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js') }}"></script>
<script src="{{ url_for('admins.static', filename='lte/style/js/adminlte.min.js') }}"></script>
<script>
    $(function(){
        $('.select2').select2()
        //Initialize Select2 Elements
        $('.select2bs4').select2({
          theme: 'bootstrap4'
        })
    })
    $(document).pjax('a:not(.no-pjax)', '#pjax-container', {fragment:'#pjax-container', timeout:8000})

    function openWin(url, w=720, h=600) {
           var iWidth=w;                          //弹出窗口的宽度;
           var iHeight=h;                         //弹出窗口的高度;
           //获得窗口的垂直位置
           var iTop = (window.screen.availHeight - 30 - iHeight) / 2;
           //获得窗口的水平位置
           var iLeft = (window.screen.availWidth - 10 - iWidth) / 2;
           window.open(url, name, 'height=' + iHeight + ',,innerHeight=' + iHeight + ',width=' + iWidth + ',innerWidth=' + iWidth + ',top=' + iTop + ',left=' + iLeft + ',status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=0,titlebar=no');
    }
</script>
{%- endif -%}
{%- block script -%}{%- endblock %}
</body>
</html>
